import React, { Component } from 'react'
import { BrowserRouter, HashRouter, Link, Route, Switch, Redirect } from 'react-router-dom'
import Login from './pages/Login/Login'
import Home from './pages/Home/Home'
import RouterAuth from './components/routerAuth/RouterAuth'
import routerConfig from './config/routerConfig'

export default class App extends Component {
  render() {
    return (
      <>
        <React.Suspense fallback={<div>123</div>}>
          <BrowserRouter>
            <Switch>
              <Redirect exact from="/" to="/login" />
              <Route path="/home" component={Home} />
              <Route path="/login" component={Login} />
              <Route
                path="/register"
                component={React.lazy(() => import('./pages/Register/Register'))}
              />

              {/* <Redirect exact from="/" to="/login" />
              <RouterAuth routerConfig={routerConfig}></RouterAuth> */}

            </Switch>
          </BrowserRouter>
        </React.Suspense>

      </>
    )
  }
}